3.6 \(\int \frac{\sec ^2(x)}{i+\cot (x)} \, dx\)

Optimal. Leaf size=20 \[ i x-i \tan (x)-\log (\sin (x))+\log (\tan (x)) \]

[Out]

I*x - Log[Sin[x]] + Log[Tan[x]] - I*Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0411211, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3516, 44} \[ i x-i \tan (x)-\log (\sin (x))+\log (\tan (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(I + Cot[x]),x]

[Out]

I*x - Log[Sin[x]] + Log[Tan[x]] - I*Tan[x]

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{\sec ^2(x)}{i+\cot (x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{x^2 (i+x)} \, dx,x,\cot (x)\right )\\ &=-\operatorname{Subst}\left (\int \left (\frac{1}{-i-x}-\frac{i}{x^2}+\frac{1}{x}\right ) \, dx,x,\cot (x)\right )\\ &=i x-\log (\sin (x))+\log (\tan (x))-i \tan (x)\\ \end{align*}

Mathematica [A]  time = 0.0327411, size = 17, normalized size = 0.85 \[ i (x-\tan (x)+i \log (\cos (x))) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(I + Cot[x]),x]

[Out]

I*(x + I*Log[Cos[x]] - Tan[x])

________________________________________________________________________________________

Maple [A]  time = 0.032, size = 13, normalized size = 0.7 \begin{align*} -i\tan \left ( x \right ) +\ln \left ( \tan \left ( x \right ) -i \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(I+cot(x)),x)

[Out]

-I*tan(x)+ln(tan(x)-I)

________________________________________________________________________________________

Maxima [A]  time = 1.27357, size = 16, normalized size = 0.8 \begin{align*} \log \left (i \, \tan \left (x\right ) + 1\right ) - i \, \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(I+cot(x)),x, algorithm="maxima")

[Out]

log(I*tan(x) + 1) - I*tan(x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{{\left ({\left (e^{\left (2 i \, x\right )} + 1\right )} e^{\left (2 i \, x\right )}{\rm integral}\left (-\frac{2 i \, e^{\left (-2 i \, x\right )}}{e^{\left (2 i \, x\right )} + 1}, x\right ) + e^{\left (2 i \, x\right )} - 1\right )} e^{\left (-2 i \, x\right )}}{e^{\left (2 i \, x\right )} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(I+cot(x)),x, algorithm="fricas")

[Out]

((e^(2*I*x) + 1)*e^(2*I*x)*integral(-2*I*e^(-2*I*x)/(e^(2*I*x) + 1), x) + e^(2*I*x) - 1)*e^(-2*I*x)/(e^(2*I*x)
 + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{2}{\left (x \right )}}{\cot{\left (x \right )} + i}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(I+cot(x)),x)

[Out]

Integral(sec(x)**2/(cot(x) + I), x)

________________________________________________________________________________________

Giac [B]  time = 1.25198, size = 74, normalized size = 3.7 \begin{align*} \frac{\tan \left (\frac{1}{2} \, x\right )^{2} + 2 i \, \tan \left (\frac{1}{2} \, x\right ) - 1}{\tan \left (\frac{1}{2} \, x\right )^{2} - 1} + 2 \, \log \left (\tan \left (\frac{1}{2} \, x\right ) - i\right ) - \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right ) - \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(I+cot(x)),x, algorithm="giac")

[Out]

(tan(1/2*x)^2 + 2*I*tan(1/2*x) - 1)/(tan(1/2*x)^2 - 1) + 2*log(tan(1/2*x) - I) - log(abs(tan(1/2*x) + 1)) - lo
g(abs(tan(1/2*x) - 1))